home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / workbench / blankery / bserverdir / sources / clients / killdma.c < prev    next >
C/C++ Source or Header  |  1994-11-26  |  2KB  |  71 lines

  1. ;/*
  2. sc KillDMA.c DATA=FAR NMINC STRMERGE NOSTKCHK IGNORE=73 STRUCTUREEQUIVALENCE NOSTDIO
  3. slink from LIB:c.o KillDMA.o to //Clients/KillDMA LIB LIB:sc.lib LIB:amiga.lib /lib/client.lib SC SD STRIPDEBUG NOICONS
  4. delete KillDMA.o
  5. quit
  6.  
  7.  KillDMA 1.2  (Client for BServer)
  8.  
  9.  Copyright © 1994 Stefano Reksten of 3AM - The Three Amigos!!!
  10.  All rights reserved.
  11. */
  12.  
  13. #include <exec/types.h>
  14. #include <exec/memory.h>
  15. #include <graphics/gfxmacros.h>
  16. #include <hardware/dmabits.h>
  17. #include <hardware/intbits.h>
  18.  
  19. #include <clib/exec_protos.h>
  20. #include <clib/intuition_protos.h>
  21. #include <clib/graphics_protos.h>
  22.  
  23. #include "/include/client.h"
  24. #include "/include/client_pragmas.h"
  25.  
  26. struct IntuitionBase *IntuitionBase;
  27. struct GfxBase *GfxBase;
  28. struct DisplayIDInformation *dinfo;
  29.  
  30. extern far struct Custom custom;
  31.  
  32. void Blank( void )
  33. {
  34. struct Screen *scr;
  35.  
  36. if ( scr = OpenScreenTags( NULL,
  37.     SA_Depth, 0,
  38.     SA_DisplayID, DISPLAYID( dinfo ),
  39.     TAG_END ) )
  40.     {
  41.     register struct ViewPort *vp = &(scr->ViewPort);
  42.  
  43.     SetRGB4( vp, 0, 0, 0, 0 );
  44.     WaitTOF();
  45.     custom.dmacon = BITCLR|DMAF_AUDIO|DMAF_SPRITE|DMAF_COPPER|DMAF_RASTER;
  46.     WaitServerCommand();
  47.     custom.dmacon = BITSET|DMAF_AUDIO|DMAF_SPRITE|DMAF_COPPER|DMAF_RASTER;
  48.     CloseScreen( scr );
  49.     }
  50. else
  51.     SendClientMsg( ACTION_FAILED );
  52. }
  53.  
  54.  
  55. void __main( char *line )
  56. {
  57. if ( IntuitionBase = (struct IntuitionBase *)OpenLibrary( "intuition.library", 37L ) )
  58.     {
  59.     if ( GfxBase = (struct GfxBase *)OpenLibrary( "graphics.library", 37L ) )
  60.         {
  61.         if ( dinfo = OpenCommunication() )
  62.             {
  63.             Blank();
  64.             CloseCommunication( dinfo );
  65.             }
  66.         CloseLibrary( (struct Library *)GfxBase );
  67.         }
  68.     CloseLibrary( (struct Library *)IntuitionBase );
  69.     }
  70. }
  71.